package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.EspTxtexp;
import com.ssish.saas.eccs.model.EspTxtexpExample;
import com.ssish.saas.eccs.model.EspTxtexpKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface EspTxtexpMapper {
    int countByExample(EspTxtexpExample example);

    int deleteByExample(EspTxtexpExample example);

    @Delete({
        "delete from ESP_TXTEXP",
        "where PAYORCD = #{payorcd,jdbcType=CHAR}",
          "and REFTYP = #{reftyp,jdbcType=VARCHAR}",
          "and REFNO = #{refno,jdbcType=VARCHAR}",
          "and RECNO = #{recno,jdbcType=DECIMAL}"
    })
    int deleteByPrimaryKey(EspTxtexpKey key);

    @Insert({
        "insert into ESP_TXTEXP (PAYORCD, REFTYP, ",
        "REFNO, RECNO, INSBY, ",
        "INSDT, UPDBY, ",
        "UPDDT, PUID, DOCURL, ",
        "ERRMSG, PAYORRETURN, ",
        "TEXTLINE)",
        "values (#{payorcd,jdbcType=CHAR}, #{reftyp,jdbcType=VARCHAR}, ",
        "#{refno,jdbcType=VARCHAR}, #{recno,jdbcType=DECIMAL}, #{insby,jdbcType=VARCHAR}, ",
        "#{insdt,jdbcType=TIMESTAMP}, #{updby,jdbcType=VARCHAR}, ",
        "#{upddt,jdbcType=TIMESTAMP}, #{puid,jdbcType=VARCHAR}, #{docurl,jdbcType=VARCHAR}, ",
        "#{errmsg,jdbcType=VARCHAR}, #{payorreturn,jdbcType=VARCHAR}, ",
        "#{textline,jdbcType=CLOB})"
    })
    int insert(EspTxtexp record);

    int insertSelective(EspTxtexp record);

    List<EspTxtexp> selectByExampleWithBLOBs(EspTxtexpExample example);

    List<EspTxtexp> selectByExample(EspTxtexpExample example);

    @Select({
        "select",
        "PAYORCD, REFTYP, REFNO, RECNO, INSBY, INSDT, UPDBY, UPDDT, PUID, DOCURL, ERRMSG, ",
        "PAYORRETURN, TEXTLINE",
        "from ESP_TXTEXP",
        "where PAYORCD = #{payorcd,jdbcType=CHAR}",
          "and REFTYP = #{reftyp,jdbcType=VARCHAR}",
          "and REFNO = #{refno,jdbcType=VARCHAR}",
          "and RECNO = #{recno,jdbcType=DECIMAL}"
    })
    @ResultMap("ResultMapWithBLOBs")
    EspTxtexp selectByPrimaryKey(EspTxtexpKey key);

    int updateByExampleSelective(@Param("record") EspTxtexp record, @Param("example") EspTxtexpExample example);

    int updateByExampleWithBLOBs(@Param("record") EspTxtexp record, @Param("example") EspTxtexpExample example);

    int updateByExample(@Param("record") EspTxtexp record, @Param("example") EspTxtexpExample example);

    int updateByPrimaryKeySelective(EspTxtexp record);

    @Update({
        "update ESP_TXTEXP",
        "set INSBY = #{insby,jdbcType=VARCHAR},",
          "INSDT = #{insdt,jdbcType=TIMESTAMP},",
          "UPDBY = #{updby,jdbcType=VARCHAR},",
          "UPDDT = #{upddt,jdbcType=TIMESTAMP},",
          "PUID = #{puid,jdbcType=VARCHAR},",
          "DOCURL = #{docurl,jdbcType=VARCHAR},",
          "ERRMSG = #{errmsg,jdbcType=VARCHAR},",
          "PAYORRETURN = #{payorreturn,jdbcType=VARCHAR},",
          "TEXTLINE = #{textline,jdbcType=CLOB}",
        "where PAYORCD = #{payorcd,jdbcType=CHAR}",
          "and REFTYP = #{reftyp,jdbcType=VARCHAR}",
          "and REFNO = #{refno,jdbcType=VARCHAR}",
          "and RECNO = #{recno,jdbcType=DECIMAL}"
    })
    int updateByPrimaryKeyWithBLOBs(EspTxtexp record);

    @Update({
        "update ESP_TXTEXP",
        "set INSBY = #{insby,jdbcType=VARCHAR},",
          "INSDT = #{insdt,jdbcType=TIMESTAMP},",
          "UPDBY = #{updby,jdbcType=VARCHAR},",
          "UPDDT = #{upddt,jdbcType=TIMESTAMP},",
          "PUID = #{puid,jdbcType=VARCHAR},",
          "DOCURL = #{docurl,jdbcType=VARCHAR},",
          "ERRMSG = #{errmsg,jdbcType=VARCHAR},",
          "PAYORRETURN = #{payorreturn,jdbcType=VARCHAR}",
        "where PAYORCD = #{payorcd,jdbcType=CHAR}",
          "and REFTYP = #{reftyp,jdbcType=VARCHAR}",
          "and REFNO = #{refno,jdbcType=VARCHAR}",
          "and RECNO = #{recno,jdbcType=DECIMAL}"
    })
    int updateByPrimaryKey(EspTxtexp record);
}